Arduino program
The Arduino program is pretty straight forward. Plenty of comments are added to the code in order to make it understandable. The main outline of the code is summarised below:
As explained in 'Mechanics', the servo was modified to suit our needs. Because of this modification, however, the standard Arduino servo library did no longer function correctly. Some adjustments were needed in this library as well. Servoplus.cpp and Servoplus.h are the new files. The are based on the Servo.cpp and Servo.h files found in your standard Arduino libraries folder (for instance C:\Program Files\arduino-0022\libraries\Servo). Unfortunately, simple information on how to adapt these libraries is hard to find and to understand without some knowledge about programming. Because this is quite a simple operation, a two-step plan is given below:
Step 1
Open two new tabs in your Arduino sketchbook. Copy-paste the Servo.h and Servo.cpp files to these tabs and save them under a new name (for instance ServoPlus.cpp and ServoPlus.h)
Step 2
First of all, the name of the library is changed from Servo to Servoplus, or whatever name you chose. This means that, in the Servoplus.h file, the lines
#ifndef Servo_h
#define Servo_h
need to be changed into
#ifndef Servoplus_h
#define Servoplus_h
In the servo.cpp, the same has to be done with the line
#include "Servo.h"
Change it to
#include "Servoplus.h"
Step 3
The servo is controlled by pulses coming from a PWM (pulse width modulation). The pulse width determines the position of the servo. This is what we want to adjust. We can do this by editing following lines.
#define MIN_PULSE_WIDTH 150 // the shortest pulse sent to a servo
#define MAX_PULSE_WIDTH 700 // the longest pulse sent to a servo
Set both values so that the desired range of your potentiometer is used. This will probably require some testing afterwards.
Step 4
Add servoplus.h to your main Arduino sketch. Pay attention! This is not done in the same way as you would include an original library. Instead of
#include
use
#include "Servoplus.h"

After adjusting MIN_PULSE_WIDTH and MAX_PULSE_WIDTH to the appropriate values, the servo should work exactly as you want it to.

Download the Arduino Program here.